1. Field of the Invention
The present invention relates to a data accessing method of a flash memory storage system and a flash memory controller system of using the same.
2. Description of Related Art
With the booming market of digital cameras, camera cell phones and MP3 players in recent years, demand for memory storage devices by consumers are rapidly increasing. Flash memories having the advantages of non-volatility, power-saving, small size and having no mechanical structure are suitable in portable applications, especially suitable for these types of portable products that are powered by batteries. Solid state drive (SSD) is a storage device using NAND flash memory as a storage medium.
Typically, the flash memory chip of the flash memory storage system is divided into several physical blocks and each physical block is further divided into several pages. The physical block is the erase unit of the flash memory and the page is the write unit of the flash memory. While the memory cells of the flash memory are programmed, the memory cells can only be unidirectional programmed (i.e. the memory cell can only be programmed from logic 1 to logic 0). Hence, the programmed page (i.e. the page having been used to store outdated data) can not be directly written with data and needed to be erased and then to be re-programmed. More particularly, since the physical block is the erase unit in the erase operation implemented on the flash memory, it is necessary to erase whole physical block when it is going to implement the erase operation to the data stored in the page of the corresponding physical block. Therefore, the conventional writing mechanism of the flash memory is implemented on a block-by-block basis. For example, in the conventional writing method, the physical blocks defined as data area and spare area. The physical blocks which are defined as the data area are used to store valid data written by the write instruction and the physical blocks defined as the spare area are used to replace the physical blocks in the data area as the write instruction is implemented. Practically, when the flash memory storage system receives the write instruction from the host system so as to implement the write operation on the physical blocks in the data area, the flash memory storage system fetches the physical blocks in the spare area and writes the valid outdated data in the physical block to be updated and the new data to be written to the fetched physical block from the spare area. Therefore, the physical block which is written with new data is correlated to the data area and the original physical block in the data area is erased and correlated to the spare area. In order, for the host system, to successfully access the physical blocks, which store data in an alternative way, the flash memory storage system allocates logical blocks for being accessed by the host system. The logical blocks are allocated according to the dimension of one or more physical blocks. On the other words, the flash memory storage system creates a logical block-physical block mapping table for recording and updating the mapping relationships between the logical blocks and the physical blocks in the data area in order to reflect the alternation between the physical blocks. Therefore, the host system accesses the flash memory storage system in accordance with the provided logical blocks and the flash memory storage system practically reads data from or writes data into the physical blocks mapping to the logical blocks according to the logical block-physical block mapping table.
Therefore, when the host system only updates a part of the data in one logical block, the data accessing method mentioned above comprises not only the action of writing new data but also the action of moving the valid outdated data within the physical blocks. More particularly, when the data quantity of the updated data is small but the data quantity of the valid outdated data is large, the time for accomplishing the write operation mentioned above is substantially increased. Specifically, the flash memory (i.e. SSD) is gradually used as the primary hard disk in the current trend of computer development and the computer operating system possesses the properties such as small amount of updated data and frequently implementing the updating process so that data writing speed of the flash memory chip seriously affects the performance of the computer system. Hence, it is necessary to develop a data accessing method capable of decreasing data moving movements so that the data writing speed for writing data into the flash memory is improved.